#ifndef UNLOADCOMM_H
#define UNLOADCOMM_H
#include "SQLSystem.h"
#include "Command.h"

#include "WherePart.h"
#include "VarcharCell.h"
#include "IntCell.h"
#include "NullCell.h"
#include <boost/tokenizer.hpp>
#include <fstream>
using namespace boost;
using std::ofstream;

class UnloadCommand :
	public Command
{
public:
	UnloadCommand(SQLSystem* sql);
	~UnloadCommand();
	virtual int execute(const string &str);
	void saveToFile(const string &file, const string &delimiter, vector<string> columnsToSave, vector<Row *> rowsToSave, Table* table);
	//this method is called by execute to save the selected rows from the where clause to the file, with each element separated by delimiter
	Helper* helper;
};

#endif
